package com.neborosoft.FlyingDog.logic.database.providers;

import com.neborosoft.FlyingDog.logic.database.AudioDataManager;
import com.neborosoft.FlyingDog.logic.database.content.identified.Album;
import com.neborosoft.lib.collections.tree.NTree;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: CM
 * Date: 02.02.13
 * Time: 0:42
 * To change this template use File | Settings | File Templates.
 */
public class AlbumsTree extends NTree{
    private static final int LEVELS_COUNT = 2;

    public AlbumsTree() {
        super(LEVELS_COUNT);
    }

    @Override
    protected List<Album> getRootItems() {
        return AudioDataManager.getInstance().getAlbums();
    }

    @Override
    protected List getChildrenOfParent(Object parent, int level, int stepsCount) {
        Album album = (Album)parent;
        return AudioDataManager.getInstance().getTracksOfAlbum(album);
    }
}
